package com.lh_travel.lohas.adapter;

import com.chad.library.adapter.base.BaseMultiItemQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.chad.library.adapter.base.entity.MultiItemEntity;

import java.util.List;
import java.util.Map;

/**
 * Created by aaron on 2018/6/8.
 */

public abstract class DoubleViewRecylerAdapter<T extends MultiItemEntity> extends BaseMultiItemQuickAdapter{

    public DoubleViewRecylerAdapter(List<T> data, Map<Integer, Integer> xmlMap) {
        super(data);

        for (Map.Entry<Integer, Integer> entry: xmlMap.entrySet()) {

            addItemType(entry.getKey(), entry.getValue());

        }

    }

    @Override
    protected void convert(BaseViewHolder baseViewHolder, MultiItemEntity multiItemEntity) {
        convertTo(baseViewHolder, (T) multiItemEntity);
    }

    public abstract void convertTo(BaseViewHolder baseViewHolder, T multiItemEntity);

}
